\chapter{The OASIS Interface}

This interface was developped with \OA\ \citep{craig_2017} (see the module's user guide:
\cite{valcke_oasis}).

\section{OASIS-related code}

Are listed below the sections of the code which are related to the use of OASIS:
\begin{itemize}
	\item 	the library \verb=oasislib=, needing only \verb=Share= and \verb=mpplib=;
	\item 	the module \verb=mod_oasis_interface.F90=, which links all \verb=oasislib=
		processes with the model's variables, and transfers the needed
		accessibility to \verb=oasislib= parameters (in the rest of the code,
		one only need to \verb=use mod_oasis_interface.F90=);
	\item	several lines in \verb=mod_params.F90= for reading the \verb=oasisparam=
		namelist (and the parameter \verb=ioasiscpl= is added to the
		\verb=physicsparam= namelist);
	\item	several lines in \verb=mod_regcm_interface.F90= for calling the needed
		subroutines along the run;
	\item	several lines in \verb=regcm.F90= for implementing the MPI initialization
		of OASIS;
	\item	appropriate lines in the \verb=Main='s \verb=Makefiles.am=;
	\item	several lines in \verb=configure.ac= for the configuration options.
\end{itemize}

OASIS-related sections are enabled only if the builder is configured with
the option \verb=--enable-oasis=. In the code, these sections (except for the parameter
\verb=ioasiscpl= which is in \verb=physicsparam= anyways) are inserted within
\begin{verbatim}
#ifdef OASIS
 ! Something to be done only in OASIS mode
#endif
\end{verbatim}

\section{Adding fields}

The interface is not exclusively for handling air-sea interactions, even though it was
initially developped for it. Indeed, its types, variables, and subroutines remain quite
general, such that one could for instance implement another exchange grid, and/or set up
the fields which are needed for a precise coupling experiment.

The locations where lines should be added for implementing new fields are notified with
the comment \verb=! OASIS field +++=, which may be \verb=grep=ped...

Any interaction between fields from OASIS and the model's variables should be done in
\verb=mod_oasis_interface.F90=, where developpers are invited to use the model's variables
which are already public.

Finally, simply adding a field should not need changes in the \verb=oasislib=, although
consulting it may be useful for understanding then handling all types, variables and
subroutines. Explicit comments are normally present in the code.
